Session 0 - Basics

Basic Computations

Click anywhere white space and type something to create a new input cell.
Press Shift+Enter/Shift+Return to evaluate the current cell. This creates a new output cell with the results.

1+2

Every undefined symbol is used as a symbolic variable.

4+x*(2x+6x)

Assign values to variables by using =.
All variables are in general global variables, valid in all further computations, even in different cells and notebooks!

y=5x+7
y*y/x

To unset the value of a variable and to use it symbolic again, use Unset

y=5
y^2
Unset[y]
y
y^2

Mathematica contains many build-in functions and symbols for constants (e.g. Pi), functions (e.g. Cos) and even complete Algorithm (e.g. FindMaximumFlow). Built-in functions start with a capital letter.
Hover any function with the mouse and click the (i) to show the help

Cos[Pi]
Expand[(x+1)^6]
CompleteGraph[5]

Arguments of functions are given in [ ], multiple arguments are separated with commas

Integrate[t*x^2+Log[x],x]

In Mathematica, almost everything is a functions, so are loops and conditions

For[i=1,i≤5,i++,Print[i]]
y=42
If[y>0,Log[y],0]

Notebook Formatting

When creating a new cell in a notebook, it is a input cell by default. Using Format -> Style -> (...) in the menu allows to create cells of different styles (e.g., text cells like this or headlines).
Inside an input cell, comments can be created by enclosing the comment in (* .... *).
Normally, every computation results in an output line. To suppress an output, end the line with a ;
The print functions allows to create output everywhere (e.g., inside other functions like the If-Function)

(* This is a comment *)
x+2
(* The next line generates no output *)
y=x+Log[x];
(* The next line generates output *)
y^2

Numerics

In general every computation is performed analytically (with some exceptions). To get a numerical value of a function, use the N[ ] function.

y=1/42+1/10000000000
N[y]
y=Log[42]
N[y]
Exp[y]